package easy;

import java.util.HashSet;
import java.util.Set;

public class Solution_1952 {

    public boolean isThree(int n) {
        int[] array = new int[]{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97};
        Set<Integer> set = new HashSet<>();
        for (int num : array) {
            set.add(num);
        }
        if (n < 4) {
            return false;
        }
        int sqrt = (int) Math.sqrt(n);
        if (sqrt * sqrt != n) {
            return false;
        }
        return set.contains(sqrt);
    }

    public static void main(String[] args) {
        Solution_1952 model = new Solution_1952();
        System.out.println(model.isThree(4));
        System.out.println(model.isThree(5));
        System.out.println(model.isThree(8));
    }
}
